import request from '@/utils/request'

/** *
 * 权限列表
 */
function permissionList() {
  return request({
    url: '/sapi/sys/permission/list',
    method: 'post'
  })
}

/** *
 * 添加权限
 * @param data
 */
function addPermission(data) {
  return request({
    url: '/sapi/sys/permission/add',
    method: 'post',
    data: data
  })
}

/** **
 * 修改权限
 * @param data
 */
function editPermission(data) {
  return request({
    url: '/sapi/sys/permission/edit',
    method: 'post',
    data: data
  })
}

/** *
 * 删除权限
 * @param id
 */
function deletePermission(id) {
  const postData = {}
  postData.id = id
  return request({
    url: '/sapi/sys/permission/delete',
    method: 'post',
    data: postData
  })
}

export default {
  permissionList: permissionList,
  addPermission: addPermission,
  editPermission: editPermission,
  deletePermission: deletePermission
}
